[FLYWOOF411] add board documentation
[inav/snaewe.git] / docs / development / Configuration Storage.md
blobf37d3e852843943ff0bd306638d074891ea6e367
1 # Configuration
3 The configuration in INAV is stored at the end of the flash ram, currently it uses 2KB of flash.
5 Sometimes it's necesaary to erase this during development.
7 ## Erasing
9 Generate a 2kb blank file.
11 ```
12 dd if=/dev/zero of=obj/blankconfig.bin bs=1024 count=2
13 ```
15 Overwrite configuration using JLink
17 Run JLink (OSX: `/Applications/SEGGER/JLink/JLinkExe`)
19 Execute commands
20 `device <your device>`, e.g. `STM32F303CB`
21 `r`
22 `h` 
23 `loadbin obj/blankconfig.bin, <address>`, address 128k device = 0x801F800, 256k device = 0x803f800
24 `r` to Reboot FC.
25 `q` to quit
27 Example session
29 ```
30 $ /Applications/SEGGER/JLink/JLinkExe
31 SEGGER J-Link Commander V4.90c ('?' for help)
32 Compiled Aug 29 2014 09:52:38
33 DLL version V4.90c, compiled Aug 29 2014 09:52:33
34 Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
35 Hardware: V7.00
36 S/N: -1 
37 Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFull 
38 VTarget = 3.300V
39 Info: Could not measure total IR len. TDO is constant high.
40 Info: Could not measure total IR len. TDO is constant high.
41 No devices found on JTAG chain. Trying to find device on SWD.
42 Info: Found SWD-DP with ID 0x2BA01477
43 Info: Found Cortex-M4 r0p1, Little endian.
44 Info: FPUnit: 6 code (BP) slots and 2 literal slots
45 Info: TPIU fitted.
46 Info: ETM fitted.
47 Cortex-M4 identified.
48 Target interface speed: 100 kHz
49 J-Link>device STM32F303CC
50 Info: Device "STM32F303CC" selected (256 KB flash, 32 KB RAM).
51 Reconnecting to target...
52 Info: Found SWD-DP with ID 0x2BA01477
53 Info: Found SWD-DP with ID 0x2BA01477
54 Info: Found Cortex-M4 r0p1, Little endian.
55 Info: FPUnit: 6 code (BP) slots and 2 literal slots
56 Info: TPIU fitted.
57 Info: ETM fitted.
58 J-Link>r
59 Reset delay: 0 ms
60 Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
61 J-Link>h
62 PC = 08001154, CycleCnt = 00000000
63 R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
64 R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
65 R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
66 R12= 00000000
67 SP(R13)= 2000A000, MSP= 2000A000, PSP= 00000000, R14(LR) = FFFFFFFF
68 XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
69 CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
70 FPU regs: FPU not enabled / not implemented on connected CPU.
71 J-Link>loadbin obj/blankconfig.bin, 0x803f800
72 Downloading file [obj/blankconfig.bin]...
73 WARNING: CPU is running at low speed (7989 kHz).
74 Info: J-Link: Flash download: Flash programming performed for 1 range (2048 bytes)
75 Info: J-Link: Flash download: Total time needed: 1.254s (Prepare: 0.698s, Compare: 0.009s, Erase: 0.075s, Program: 0.405s, Verify: 0.005s, Restore: 0.059s)
76 O.K.
77 J-Link>r
78 Reset delay: 0 ms
79 Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
80 J-Link>q
81 ```